<?php
class My_xmlrpc_category {
	static function categorys() {
		$db = Zend_Registry::get ( 'db' );
		$select = new Zend_Db_Select ( $db );
		$select->from ( 'bc_lanmu' );
		return $db->fetchAll ( $select );
	}
	public static function getHush() {
		foreach ( self::categorys () as $var ) {
			$a [$var ['id']] = $var ['name'];
		}
		return $a;
	}
	public static function getHushFlip() {
		return array_flip ( self::gethush () );
	}
	public static function getGroups() {
		$a = new My_Helper_Array ( );
		return $a->array_group_by ( self::categorys (), 'kid' );
	}
	public static function getGroup($kid) {
		$a = self::getGroups ();
		return $a [$kid];
	}

}
?>